<?php

/*

Action - Attack	$4

 +$2
Each other player discards a Copper card (or reveals a hand with no Copper).

 */

 class Cutpurse extends Card implements iAction, iKingdom, iAttack, iSeaside {

    public function __construct() {
        parent::__construct("Cutpurse", 4);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+$2",
            "Each other player discards a Copper card (or reveals a hand with no Copper).");
    }
    
    public function play(Game $game, $isRealCard) {
        $game->addMoney(new Price(2));
         ScreenDisplay::addScreenMessage($game, true, "get +2$", "gets +2$"); 
        $game->attack($this);
        
        $names = $game->getOtherPlayersNames(true);
        foreach ($names as $name) {
            $copper = $game->moveCardFromPileToPile("Copper", PlayHand, DiscardPile, $name);
             ScreenDisplay::addScreenMessage($game, true, "discard ".  nicePrint($copper),"discards ".ScreenDisplay::$LMSG, $name);
        }
		$game->cardActionFinished();
        return true;
    }

}
?>